package lab.gene.action;

import java.util.Date;
import lab.gene.pojo.GeneAmplification;
import lab.gene.service.impl.GeneAMPServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

public class ViewGeneAMPAction extends ActionSupport  {

	private static final long serialVersionUID = 1L;
	private String geneName = null;
	private Date recordDate = null;
	private String comments = null;
	private Float ml;
	private Float volume;
	private Float excess;
	private String stored;
	private String position;
	private String stepType;
	
	public String execute() {
		
		GeneAMPServiceImpl service = new GeneAMPServiceImpl();
		GeneAmplification geneAMP = service.getGeneAMP(geneName, stepType);
		String result = "successA";
		System.out.println("**********************AMP action");
		System.out.println(geneName);
		System.out.println(stepType);
		if(geneAMP != null) {
			recordDate = geneAMP.getRecordDate();
			comments = geneAMP.getComments();
			volume = geneAMP.getVolume();
			excess = geneAMP.getExcess();
			ml = geneAMP.getMl();
			stored = geneAMP.getStored();
			position = geneAMP.getPosition();

		}
		
		System.out.println("end Gene AMP action");
		switch(stepType) {
		case "A":
			result = "successA";break;
		case "C":
			result = "successC";break;
		case "D":
			result = "successD";break;
		}
		
		System.out.println(result);
		return result;
	}

	public Date getRecordDate() {
		return recordDate;
	}

	public void setRecordDate(Date recordDate) {
		this.recordDate = recordDate;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public Float getMl() {
		return ml;
	}

	public void setMl(Float ml) {
		this.ml = ml;
	}

	public Float getVolume() {
		return volume;
	}

	public void setVolume(Float volume) {
		this.volume = volume;
	}

	public Float getExcess() {
		return excess;
	}

	public void setExcess(Float excess) {
		this.excess = excess;
	}

	public String getStored() {
		return stored;
	}

	public void setStored(String stored) {
		this.stored = stored;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getGeneName() {
		return geneName;
	}

	public void setGeneName(String geneName) {
		this.geneName = geneName;
	}

	public String getStepType() {
		return stepType;
	}

	public void setStepType(String stepType) {
		this.stepType = stepType;
	}

}
